package mr

//
// RPC definitions.
//
// remember to capitalize all names.
//

import "os"
import "strconv"

//
// example to show how to declare the arguments
// and reply for an RPC.
//
type RegisterWorkerArgs struct {
}
type RegisterWorkerReply struct {
	FileNames []string
	TaskID    int
	InputCnt int
	ReplyCode int //-1 for error,0 for done,1 for map,2 for reduce,3 for waiting
}

type WorkerRetArgs struct {
	TaskID int
	WorkMode int //1 for map, 2 for reduce
	ErrCode  int
}
type WorkerRetReply struct {
}
type ExampleArgs struct {
	X int
}

type ExampleReply struct {
	Y int
}

// Add your RPC definitions here.

// Cook up a unique-ish UNIX-domain socket name
// in /var/tmp, for the coordinator.
// Can't use the current directory since
// Athena AFS doesn't support UNIX-domain sockets.
func coordinatorSock() string {
	s := "/var/tmp/824-mr-"
	s += strconv.Itoa(os.Getuid())
	return s
}
